//import java.util.Scanner;
//
//class Animal {
//    protected String name;
//    public void showName() {
//        System.out.print(name + ",");
//    }
//    public void cry() {
//        System.out.print("Different animals make different sounds");
//    }
//}
//
//class Dog extends Animal {
//    public Dog(String name) {
//        this.name = name;
//    }
//
//    public void swimming() {
//        System.out.println("can swimming.");
//    }
//
//    @Override
//    public void cry() {
//        System.out.print("wang...wang,");
//    }
//}
//
//class Cat extends Animal {
//    public Cat(String name) {
//        this.name = name;
//    }
//
//    public void climbUpTree() {
//        System.out.println("can climb the tree.");
//    }
//
//    @Override
//    public void cry() {
//        System.out.print("miao...miao,");
//    }
//}
//
//public class test {
//    public static void main(String args[]) {
//        Scanner in = new Scanner(System.in);
//        System.out.println("please input a name for the dog");
//        Dog dog = new Dog(in.nextLine());
//        System.out.println("please input a name for the cat");
//        Cat cat = new Cat(in.nextLine());
//        dog.showName();
//        dog.cry();
//        dog.swimming();
//        cat.showName();
//        cat.cry();
//        cat.climbUpTree();
//    }
//}

import java.util.Scanner;

class Shape {
    public void getarea() {

    }
}

class Triangle extends Shape {
    double a, b;

    public Triangle(double a, double b) {
        this.a = a;
        this.b = b;
    }

    @Override
    public void getarea() {
        double area = a * b / 2.0;
        System.out.println(area);
    }
}

class Rectangle extends Shape {
    double a, b;

    public Rectangle(double a, double b) {
        this.a = a;
        this.b = b;
    }

    @Override
    public void getarea() {
        double area = a * b;
        System.out.println(area);
    }
}

class Circle extends Shape {
    double r;

    public Circle(double r) {
        this.r = r;
    }

    @Override
    public void getarea() {
        double area = 3.14 * r * r;
        System.out.println(area);
    }
}

public class test {
    public static void main(String[] args) {
        Integer a = 1;
        Integer b = 2;
        swap(a,b);
        System.out.println(a + " " + b);
    }
    public static void swap(Integer a, Integer b) {
        Integer t = a;
        a = b;
        b = t;
    }
    public static void main1(String[] args) {
        Scanner scanner = new Scanner(System.in);
        char ch = scanner.next().charAt(0);
        if (ch == 'C') {
            double r = scanner.nextDouble();
            Circle circle = new Circle(r);
            circle.getarea();
        } else if (ch == 'T') {
            double a = scanner.nextDouble();
            double b = scanner.nextDouble();
            Triangle triangle = new Triangle(a, b);
            triangle.getarea();
        } else if (ch == 'R') {
            double a = scanner.nextDouble();
            double b = scanner.nextDouble();
            Rectangle rectangle = new Rectangle(a, b);
            rectangle.getarea();
        }
    }
}